<template>
	<view class="content">
		<view class="headerTitle">用户登录</view>
		<text class="title">{{title}}</text>
		<form @submit="userLoginformSubmit">
			<view class="uni-form-item uni-column">
				<view class="uni-title uni-common-pl">帐号：</view>
				<input class = "uni-input" name = "username" v-model="username"/>
			</view>
			<view class="uni-form-item uni-column">
				<view class="uni-title uni-common-pl">密码：</view>
				<input class = "uni-input" name = "password" type = "password" v-model="password"/>
			</view>
			<button form-type="submit" type='primary'>登录</button>
		</form>
	</view>
</template>

<script>
	import userInfoConst from '../../common/userInfoConst.js'
	export default {
		data() {
			return {
				title: '',
				username:'admin',
				password:'admin',
				token:''
			}
		},
		onLoad() {
			
		},
		methods: {
			userLoginformSubmit:function(e){
				const userInfoObj = e.detail.value;
				userInfoConst.getUserByLogin(userInfoObj.username,userInfoObj.password,this.$myRequest);
			}
		}
	}
</script>

<style>
	.headerTitle{
		font-size: 18px;
		text-align: center;
	}
	.uni-input{
		width: 90%;
		margin: 10px auto;
		
	}
	.uni-form-item .title {
		padding: 20rpx 0;
	}
</style>
